<?php

class Zend_View_Helper_JsonEncodeTableRow
{
    function jsonEncodeTableRow($obj)
    {        
        $output = '{';
        $properties = array();
        
        $vars = $obj->toArray();
        foreach($vars as $k => $v) {
            $properties[] = "'" . $k . "': '" . str_replace("\n", '\n', addslashes(htmlentities($v))) . "'";
        }
        
        $output .= implode(',', $properties) . '}';
        return $output;
    }
}